Elements Must Be Well-formed
This documentation is for an older version of ZK. For the latest one, please click here.
First, each element must be closed. They are two ways to close an element as depicted below. They are equivalent.
Close by an end tag: | <window></window>
|
Close without an end tag: | <window/>
|
Second, elements must be properly nested.
Correct: | <window>
<groupbox>
Hello World!
</groupbox>
</window>
|
Wrong: | <window>
<groupbox>
Hello World!
</window>
</groupbox>
|
XML treats every tag as a node in a tree. A node without a parent node is a root component, and it is the root of a tree. In each zul file, only ONE tree is allowed.
For example, for being a whole zul file, the following is allowed, for it has only one root component.
<button/>
And for being a whole zul file, the following is not allowed, for it has more than one root component.
<button/>
<button/>
You can solve the problem by simply adding a tag enclosing the whole zul file to serve as the parent node, so the zul file has one single tree again.
<window>
<button />
<button />
</window>